import React from 'react';
import {PageContainer} from '@ant-design/pro-components';
import {CopyOutlined} from '@ant-design/icons';
import {Card, Flex, Typography, Space, message,} from 'antd';

const urlPrefixHttp = 'http' + '://';
const urlXbJ1c: string = '1.singbon.com:81';
const urlXbJ1cBack: string = urlXbJ1c + '/singbon/backgroud/system/admin/login.do';

const NavFloatButton: React.FC = () => {
  const {Link} = Typography;
  const [messageApi, contextHolder] = message.useMessage();
  const openMsg = (msgType: 'info' | 'success' | 'warning' | 'error', msgSuccess: string) => {
    messageApi.open({
      type: msgType,
      content: msgSuccess,
      duration: 1,
    }).then(() => {});
  };
  return (
    <PageContainer>
      {contextHolder}
      <Card style={{borderRadius: 8,}}>
        <Space direction="vertical">
          <Flex justify="space-between" gap={18}>
            <Space direction="vertical">
              <Link href={urlPrefixHttp + urlXbJ1c} target="_blank" copyable={{text: function () {return urlXbJ1c;}, onCopy: function () {openMsg('success', urlXbJ1c);}, icon: <CopyOutlined/>, tooltips: '复制链接', format: 'text/plain', tabIndex: 1,}}>j1c</Link>
              <Link href={urlPrefixHttp + urlXbJ1cBack} target="_blank" copyable={{text: function () {return urlXbJ1cBack;}, onCopy: function () {openMsg('success', urlXbJ1cBack)}, icon: <CopyOutlined/>, tooltips: '复制链接', format: 'text/plain', tabIndex: 1,}}>j1cb</Link>
            </Space>
          </Flex>
        </Space>
      </Card>
    </PageContainer>
  );
};

export default NavFloatButton;
